using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Runtime.Serialization;
using Arch.Aspects;

namespace Arch.Samples.Model
{
    [DataContract(IsReference = true)]
    [
        Order("Name"),
        SecurityAccess(ReadAccess = Access.Authentified, WriteRoles = "Admin"),
    ]
    public partial class SubCategory : Category
    {
        [DataMember]
        [Display(AutoGenerateField = false)]
        public virtual int GlobalCategoryId { get; set; }

        [DataMember]
        [EntityRequired]
        //[AssociationAttribute("SubCategory_GlobalCategory", "GlobalCategoryId", "Id", IsForeignKey = true )]
        public virtual GlobalCategory GlobalCategory { get; set; }

        [DataMember]
        [Display (AutoGenerateField = false)]
        //[AssociationAttribute("Todo_SubCategory", "Id", "SubCategoryId")]
        public virtual ICollection<Todo> Todoes { get; set; }
    }
}
